<?php
class Default_Form_Contact extends Ext_Form
{
	public function init()
	{
		$this->addElement('text', 'name', array(
            'required'   => true
        ));
		
        $this->addElement('text', 'mail', array(
        	'validators' => array('EmailAddress') ,
            'required'   => true
        ));

        $this->addElement('text', 'telefono', array(
            'required'   => false
        ));
                
        $this->addElement('text', 'titulo', array(
            'required'   => true
        ));
        
		$this->addElement('textarea', 'descripcion', array(
            'required' => true,
			'attribs' => array( 'rows' => 10, 'cols' => 40 )
        ));
        
        // Add the submit button
        $this->addElement( 'submit', 'enviar' );
        
        $this->removeAllDecorators();
        
        // renderer de este form
        $this->setDecorators( 	
			array( 
				array( 
					'ViewScript', 
					array( 'viewScript' => 'node/contactForm.phtml' ) 
				) 
			) 
		);
        
	}
}